class App {
    config: any
    logger: any
    gameName: string
    env: string
    version: string
    minVersion: string
    minMax: number
    minMin: number
    arenaFork: any
    csFork: any
    serverState: number //服务器状态 0 正常, 1维护中
    stateText: string
    playerSessionForks: any
    playerSessionForksByID: any
    forkmessageCb: any
    messageID: number
    forkID: number
    constructor() {
        this.config = null
        this.logger = null
        this.env = ''
        this.version = '1.1'
        this.minVersion = '1.1'
        this.minMax = 1
        this.minMin = 1
        this.arenaFork = null
        this.csFork = null
        this.serverState = 0
        this.stateText = "服务器维护中"
        this.playerSessionForks = []
        this.playerSessionForksByID = {}
        this.messageID = 0
        this.forkmessageCb = {}
    }

    sendMessage(fork, url, sessionKey, data): Promise<any> {
        this.messageID += 1
        fork.send({ messageID: this.messageID, url, sessionKey, data: data })
        return new Promise(async resolve => {
            this.forkmessageCb[this.messageID] = (msg) => {
                resolve(msg)
            }
        })
    }
}

let app = new App()
export default app